from qiniu import urlsafe_base64_encode

# 本地txt文件路径
localPath = "/Users/lixianhe/Downloads/list1.txt"

# 域名
domain = 'rywcjs3ti.hd-bkt.clouddn.com'

urls = []
file = open(localPath, "r", encoding="UTF-8")
for line in file:
    url = 'http://' + domain + '/' + line
    urls.append(url)
file.close()

# 写入文件
outputPath = '/Users/lixianhe/Downloads/mkzip27.txt'
file = open(outputPath, "w", encoding="UTF-8")
for i, url in enumerate(urls):
    # 屏蔽掉初始的Key
    if i == 0:
        continue
    file.write('/url/' + urlsafe_base64_encode(url) + '\n')
print('文件写入完毕')
file.close()
